package com.mucd.chat.controller;

import com.mucd.chat.service.MessageListService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.MessageListModel;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author mucd
 */
@RestController
@RequestMapping("messageList")
public class MessageListController {

    @Resource
    private MessageListService messageListService;


    /**
     * 查询首页聊天列表
     */
    @PostMapping("selectMessageList")
    public R<?> selectChatList() {
        return R.ok(messageListService.selectMessageList());
    }
    /**
     * 查询首页聊天列表
     */
    @PostMapping("clearMessageNotRead")
    public R<?> clearMessageNotRead(@RequestBody MessageListModel model) {
        return R.ok(messageListService.clearMessageNotRead(model));
    }

}
